package com.deram.ctin.rest.web.controller.web;

import com.deram.ctin.dependencies.rest.base.BaseController;
import com.deram.ctin.serv.system.api.SystemSearchApi;
import com.deram.ctin.serv.system.consts.SystemSearchConsts;
import com.deram.ctin.serv.system.entity.SystemSearch;
import com.deram.ctin.serv.system.filter.SystemSearchFilter;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = {"web - 基础数据"})
@RestController
@RequestMapping("/web/data")
public class WebDataController extends BaseController {

    @Autowired
    private SystemSearchApi systemSearchApi;

    @ApiOperation(value = "热搜列表")
    @GetMapping("/entSearchWord")
    public List<SystemSearch> entSearchWord() {
        SystemSearchFilter filter = new SystemSearchFilter();
        filter.setType(SystemSearchConsts.TYPE_ENT);
        return systemSearchApi.list(filter);
    }
}
